package com.qwc.blog.config;

import com.qwc.blog.service.ISysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author qiuwencong
 * @Date 2022/1/24 16:16
 * @Package com.qwc.blog.config
 * @Description
 */
@Slf4j
@Component
public class InitConfigApplication implements ApplicationRunner {

    @Autowired
    private ISysConfigService configService;

    @Autowired
    private InitProperties initProperties;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("{}",initProperties);
        configService.initConfig(initProperties);
        log.info("初始化配置成功");
    }
}
